@import url('@/config/custom.less');
@import url('@/assets/fonts/fonts.less');

/**
global 放外层会影响所有组件的样式
但尝试了许多方法，选择器无法命中到 calendar，只能使用这个冒险的方法了
*/
:global {
  .rv-calendar__popup {
    height: 68% !important;
  }
  .rv-calendar__header-title {
    height: 40px;
  }
}
.add-wrap {
  font-family: WeChatSans-Regular;
  padding-top: 12px;
  :global {
    .rv-number-keyboard {
      position: unset;
      &__keys {
        font-family: WeChatSans-Regular;
      }
      .rv-key--blue {
        background-color: @primary;
      }
    }
    .rv-field {
      padding: 0;
      &__label {
        width: 30px;
      }
      &__body {
        position: relative;
      }
      &__clear {
        font-size: 34px;
        position: absolute;
        right: 10%;
      }
      &__word-limit {
        position: absolute;
        top: 0;
        right: 0;
      }
    }
  }
  .header {
    padding: 0 20px;

    .close-wrap {
      display: flex;
      align-items: center;

      :global {
        .rv-icon-cross {
          font-size: 26px;
          color: @color-text-secondary;
        }
      }
    }

    .add-btn {
      padding: 0 12px;
      background-color: @primary;
      border-color: @primary;
    }
  }
  .filter-wrap {
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .type {
      span {
        display: inline-block;
        background: #f5f5f5;
        color: @color-text-caption;
        padding: 6px 12px;
        font-size: 14px;
        border-radius: 4px;
      }
      .expense {
        margin-right: 8px;
        &.active {
          background-color: #dbf7ee;
          border-color: @primary;
          color: @primary;
        }
      }
      .income {
        &.active {
          background-color: #fff4d5;
          border-color: @text-warning;
          color: @text-warning;
        }
      }
    }
    .date {
      display: flex;
      align-items: center;
      height: 32px;
      padding: 8px 6px 8px 8px;
      background-color: #f0f0f0;
      border: none;
      border-radius: 4px;
      color: @color-text-base;
      font-size: 14px;
      .icon-sort-down {
        use {
          transform: translateY(-20%);
        }
      }
    }
  }

  .numberPad {
    padding-bottom: 12px;
    border-bottom: 1px solid #e9e9e9;
    padding: 0 20px;
    .prefix {
      font-size: 40px;
      font-weight: bold;
    }
    .amount {
      font-size: 40px;
      padding-left: 10px;
      font-family: WeChatSans-Medium;
    }
  }
  .animation::after {
    content: '';
    display: inline-block;
    margin-left: 5px;
    width: 2px;
    height: 30px;
    animation: blink 1s infinite steps(1, start);
  }
  @keyframes blink {
    0% {
      background-color: white;
    }
    50% {
      background-color: @color-text-secondary;
    }
    100% {
      background-color: white;
    }
  }
  .type-wrap {
    .type-body {
      display: flex;
      flex-wrap: wrap;
      padding: 10px 6px 0 6px;
      height: 140px;
      .type-item {
        width: calc(100% / 6);
        height: 50%;
        padding: 10px 0;
        border: none;
        border-radius: 4px;
        :global {
          .rv-button__text {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
          }
        }
        .icon-wrap {
          display: flex;
          justify-content: center;
          align-items: center;
          background-color: #f5f5f5;
          border-radius: 50%;
          width: 30px;
          height: 30px;
          margin-bottom: 4px;
          color: @color-text-caption;
          font-size: 22px;
          // 相比于 Monkee-Account 这里省去.type-icon
          // .type-icon {
          //   color: @color-text-caption;
          //   font-size: 22px;
          // }
        }
        .expense {
          &.active {
            background-color: @primary;
            // 相比于 Monkee-Account 这里省去.type-icon
            color: #fff;
          }
        }
        .income {
          &.active {
            background-color: @text-warning;
            color: #fff;
          }
        }
      }
    }
  }
  .remark {
    .rv-cell {
      padding: 0;
    }
    padding: 14px 20px;
  }
}
